package com.edu.bhu.admin.domain;

import java.util.Date;

import com.edu.bhu.common.core.domain.entity.SysUser;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.edu.bhu.common.annotation.Excel;
import com.edu.bhu.common.core.domain.BaseEntity;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 借阅信息对象 lib_loan
 * 
 * @author wangweibo
 * @date 2022-02-14
 */
public class LibLoan extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** $column.columnComment */
    private Long loanId;

    /** 关联书本 */
    @Excel(name = "关联书本")
    private Long bookId;

    /** 关联用户 */
    @Excel(name = "关联用户")
    private Long userId;

    /** 借出时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "借出时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date loanTime;

    /** 预计归还时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "预计归还时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date preReturnTime;

    /** 实际归还时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "实际归还时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date praReturnTime;

    /** 删除标志（0代表存在 2代表删除） */
    private String delFlag;

    //============非字段属性============//

    /** 借出状态 1.正常借阅 2.逾期未归还 3.正常归还 4.逾期已归还*/
    private Long loanStatus;

    /** 关联书本对象 */
    private LibBook libBook;

    /** 关联用户对象 */
    private SysUser sysUser;

    /** 批量添加的书本ids */
    private String[] bookIds;

    public void setLoanId(Long loanId) 
    {
        this.loanId = loanId;
    }

    public Long getLoanId() 
    {
        return loanId;
    }
    public void setBookId(Long bookId) 
    {
        this.bookId = bookId;
    }

    public Long getBookId() 
    {
        return bookId;
    }
    public void setUserId(Long userId) 
    {
        this.userId = userId;
    }

    public Long getUserId() 
    {
        return userId;
    }
    public void setLoanTime(Date loanTime) 
    {
        this.loanTime = loanTime;
    }

    public Date getLoanTime() 
    {
        return loanTime;
    }
    public void setPreReturnTime(Date preReturnTime) 
    {
        this.preReturnTime = preReturnTime;
    }

    public Date getPreReturnTime() 
    {
        return preReturnTime;
    }
    public void setPraReturnTime(Date praReturnTime) 
    {
        this.praReturnTime = praReturnTime;
    }

    public Date getPraReturnTime() 
    {
        return praReturnTime;
    }

    public LibBook getLibBook() {
        return libBook;
    }

    public void setLibBook(LibBook libBook) {
        this.libBook = libBook;
    }

    public SysUser getSysUser() {
        return sysUser;
    }

    public void setSysUser(SysUser sysUser) {
        this.sysUser = sysUser;
    }

    public Long getLoanStatus() {
        return loanStatus;
    }

    public void setLoanStatus(Long loanStatus) {
        this.loanStatus = loanStatus;
    }

    public String[] getBookIds() {
        return bookIds;
    }

    public void setBookIds(String[] bookIds) {
        this.bookIds = bookIds;
    }

    public String getDelFlag() {
        return delFlag;
    }

    public void setDelFlag(String delFlag) {
        this.delFlag = delFlag;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("loanId", getLoanId())
            .append("bookId", getBookId())
            .append("userId", getUserId())
            .append("loanTime", getLoanTime())
            .append("preReturnTime", getPreReturnTime())
            .append("praReturnTime", getPraReturnTime())
            .toString();
    }
}
